package com.baidu.service;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import com.baidu.domain.Car;
import com.baidu.domain.User;

@Path("/userService")
@Produces("*/*")
public interface IUserService {
	
	@PUT
	@Path("/user")
	@Consumes({"application/xml","application/json"})
	public void saveUser(User user);
	
	@PUT
	@Path("/user")
	@Consumes({"application/xml","application/json"})
	public void updateUser(User user);
	
	@GET
	@Path("/user")
	@Produces({"application/xml","application/json"})
	public List<User> findAllUsers();
	
	@GET
	@Path("/user/{id}")  // 问题1：如果添加参数，就一定要加参数，不然会找不到方法
	@Produces({"application/xml","application/json"})
	public User findUserById(@PathParam("id") Integer id);

	@DELETE
	@Path("/user/{id}")
	@Consumes("application/xml")
	public void deleteUser(@PathParam("id") Integer id);
}
